from rest_framework import serializers
from utils.base import BaseSerializer
from apps.interfaces.models import Api


class ApiSerializers(BaseSerializer):
    module_name = serializers.CharField(source='module.name', read_only=True)
    plant_name = serializers.CharField(source='module.plant.name', read_only=True)
    service_name = serializers.CharField(source='service.name', read_only=True)

    class Meta:
        model = Api
        fields = '__all__'

